home *** CD-ROM | disk | FTP | other *** search
- unit tlm_mod;
- interface
- uses tl_inter;
-
- type
- ParBlk=Record (* der Parameterblock TYPE für's VDI *)
- p_cntrl:^integer;
- p_intin:^integer;
- p_ptsin:^integer;
- p_intout:^integer;
- p_ptsout:^integer;
- end;
-
- var (* die arrays fürs vdi und das handle *)
- contrl:array [0.. 11] of integer;
- intin :array [0..127] of integer;
- intout:array [0..127] of integer;
- ptsin :array [0..127] of integer;
- ptsout:array [0..127] of integer;
- vdi_hnd:integer;
-
- (* der Parameterblock HIMSELF für's VDI *)
-
- const VdiParBlk:ParBlk
- =
- ( p_cntrl:@contrl;
- p_intin:@intin;
- p_ptsin:@ptsin;
- p_intout:@intout;
- p_ptsout:@ptsout;
- );
-
- procedure TLM_START(tl_info:INFO_PTR);
-
- implementation
-
- {$S-}
- {$L-}
- {$V-}
- {$D-}
- {$I-}
-
- type
-
- GRECT= (* typ eines GRECT's *)
- record
- x,y,w,h:integer;
- end;
-
- GRECT_PTR=^GRECT; (* ein pointer darauf *)
-
-
- (* ein paar VDI funktionen *)
-
- procedure rect(x1,y1,x2,y2:integer);
- begin
- ptsin[0]:=x1;
- ptsin[1]:=y1;
- ptsin[2]:=x2;
- ptsin[3]:=y2;
- contrl[0]:=11; (* GDP *)
- contrl[1]:=2; (* 2 punkte *)
- contrl[2]:=0; (* 0 ptsout *)
- contrl[3]:=0; (* no intin's *)
- contrl[4]:=0; (* *)
- contrl[5]:=1; (* v_bar *)
- contrl[6]:=vdi_hnd;
- VDI();
- end;
-
- procedure line(x1,y1,x2,y2:integer);
- begin
- ptsin[0]:=x1;
- ptsin[1]:=y1;
- ptsin[2]:=x2;
- ptsin[3]:=y2;
- contrl[0]:=6; (* v_pline *)
- contrl[1]:=2; (* 2 punkte *)
- contrl[2]:=0; (* 0 ptsout *)
- contrl[3]:=0; (* no intin's *)
- contrl[4]:=0; (* *)
- contrl[6]:=vdi_hnd;
- VDI();
- end;
-
- procedure set_para(para,vdi_func:integer);
- begin
- intin[0]:=para;
- contrl[0]:=vdi_func; (* vsl_color *)
- contrl[1]:=0; (* 0 punkte *)
- contrl[2]:=0; (* 0 punkte *)
- contrl[3]:=1; (* 1 intin's *)
- if vdi_func=17 then
- contrl[4]:=1 (* color 1 zurück *)
- else
- contrl[4]:=0; (* sonst keinen *)
- contrl[6]:=vdi_hnd;
- VDI();
- end;
-
- procedure wrmode(m:integer); begin set_para(m,32); end;
- procedure ltype( l:integer); begin set_para(l,15); end;
- procedure lcolor(c:integer); begin set_para(c,17); end;
- procedure finter(c:integer); begin set_para(c,23); end;
- procedure fstyle(c:integer); begin set_para(c,24); end;
- procedure fcolor(c:integer); begin set_para(c,25); end;
-
- procedure lwidth( l:integer);
- begin
- ptsin[0]:=l;
- ptsin[1]:=0;
- contrl[0]:=16; (* vsl_color *)
- contrl[1]:=1; (* 1 punkte *)
- contrl[2]:=1;
- contrl[3]:=0; (* 1 intin's *)
- contrl[4]:=0; (* 1 intin's *)
- contrl[6]:=vdi_hnd;
- VDI();
- end;
-
- procedure lends( beg, ende:integer);
- begin
- intin[0]:=beg;
- intin[1]:=ende;
- contrl[0]:=108; (* vsl_color *)
- contrl[1]:=0; (* 1 punkte *)
- contrl[2]:=0;
- contrl[3]:=2; (* 1 intin's *)
- contrl[4]:=0; (* 1 intin's *)
- contrl[6]:=vdi_hnd;
- VDI();
- end;
-
- (* bei Übergabe von NIL clipping AUS, sonst auf das Rechteck, auf das der pointer zeigt AN *)
-
- procedure set_clip(rect: GRECT_PTR);
- begin
- if(rect<>NIL) then
- with rect^ do
- begin
- ptsin[0]:=x;
- ptsin[1]:=y;
- ptsin[2]:=x+w-1;
- ptsin[3]:=y+h-1;
- intin[0]:=1;
- end
- else
- intin[0]:=0;
- contrl[0]:=129; (* vs_clip *)
- contrl[1]:=2; (* 0 punkte *)
- contrl[2]:=0; (* 0 punkte zurück *)
- contrl[3]:=1; (* 1 intin's *)
- contrl[4]:=0; (* 0 ints zurück *)
- contrl[6]:=vdi_hnd;
- VDI();
- end;
-
- (* dummy random function *)
-
- var sseeeedd:longint;
-
- function random(range:integer):integer;
- begin
- sseeeedd:=sseeeedd*1145314615+12345;
- random:=integer( (longint(range)*sseeeedd)shr 16);
- end;
-
- procedure TLM_START(tl_info:INFO_PTR);
- var clip:GRECT;
- c,x,dir:integer;
- begin
- sseeeedd:=ms200;
- c:=1;
- vdi_hnd:=tl_info^.tl_handle;
- clip.x:=0;
- clip.y:=0;
- clip.w:=tl_info^.max_x+1;
- clip.h:=tl_info^.max_y+1;
- wrmode(1);
- ltype(1);
- lwidth(3);
- lends(1,1);
-
- (* finter(1);
- fstyle(4);
- *)
- x:=0;
- dir:=10;
- set_clip(@clip);
- repeat
-
- lcolor(c);
- if (c>=tl_info^.max_colors) then
- c:=0
- else
- c:=c+1;
- if(dir>0)and(x+dir>tl_info^.max_x) then dir:= -dir;
- if(dir<0)and(x+dir<0) then begin dir:= -dir; x:=x+3; end;
- x:=x+dir;
- line(x,0,x,tl_info^.max_y);
-
- until (tl_info^.tl_check()<>0);
- end;
-
- end.